const mysqlConfig = require("./mysqlConfig");
const mysql = require("mysql");
const poolConf = {
  pool: {},
  create() {
    this.pool = mysql.createPool(mysqlConfig);
  },
  connect(sql, arr, cb) {
    this.pool.getConnection(function (err, connection) {
      connection.query(sql, arr, function (err, data) {
        cb(err, data);
      });
      connection.release();
    });
  },
};
poolConf.create();
module.exports = poolConf;
